import './assets/main.css'

import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import {http,httpRequest,asyncHttp,asyncHttpJson,asyncHttpConfig} from './utils/request.js'
import {confirmMessage,confirmMessageMember,hintMessage,promptMessage,warningMessage} from './utils/index.js'
import store from './stores/index.js'
import Vuex from 'vuex'

import App from './App.vue'
import router from './router'

const app = createApp(App)

//注册全局属性
app.config.globalProperties.$http=http
app.config.globalProperties.$httpRequest=httpRequest
app.config.globalProperties.$asyncHttp=asyncHttp
app.config.globalProperties.$asyncHttpJson=asyncHttpJson
app.config.globalProperties.$asyncHttpConfig=asyncHttpConfig
app.config.globalProperties.$store = store

app.config.globalProperties.$confirmMessage=confirmMessage
app.config.globalProperties.$confirmMessageMember=confirmMessageMember
app.config.globalProperties.$hintMessage=hintMessage
app.config.globalProperties.$promptMessage=promptMessage
app.config.globalProperties.$warningMessage=warningMessage

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(Vuex)
app.use(router)
app.use(ElementPlus,{
  locale: zhCn,
})

app.mount('#app')
